package com.su.dolphin.common;

import com.su.dolphin.utils.LogUtil;
import com.su.dolphin.utils.SystemUtil;

/**
 * 存储App运行时候的各种数据
 * 
 * @author alex
 */
/**
 * 存储App运行时候的各种数据 包括 App_vercode, app version package, 手机的版本, 型号, imei 设备id等等
 * 
 * @author alex
 */
public class DpAppInfo
{
    public static int APP_VERCODE = 0;
    public static String APP_VERSION = null;
    public static String APP_PACKAGE = null;
    public static String APP_CHANNEL = null;
    public static boolean APP_DEBUGMODE = false;
    public static boolean APP_DEVMODE = false; //开发者模式
    
    public static String PHONE_ANDROID_VERSION = null;
    public static int PHONE_ANDROID_SDK_INT = 0;
    public static String PHONE_MODEL = null;
    public static String PHONE_MANUFACTURER = null;
    public static String PHONE_IMEI = null;
    public static String PHONE_DEVICEID = null;
    
    public static void init() {
        APP_VERSION = "" + SystemUtil.getVersionName();
        APP_PACKAGE = SystemUtil.getPackageName();
        APP_VERCODE = SystemUtil.getVersionCode();
        //        APP_CHANNEL = AnalyticsConfig.getChannel(TmApp.getContext());
        //        APP_DEBUGMODE = !SystemUtil.isReleaseVersion();
        PHONE_ANDROID_VERSION = android.os.Build.VERSION.RELEASE;
        PHONE_MODEL = android.os.Build.MODEL;
        PHONE_MANUFACTURER = android.os.Build.MANUFACTURER;
        PHONE_ANDROID_SDK_INT = android.os.Build.VERSION.SDK_INT;
        PHONE_IMEI = SystemUtil.getIMEI();
        PHONE_DEVICEID = SystemUtil.getDeviceId();
        printInfo();
    }
    
    public static void printInfo() {
        LogUtil.i("TmAppInfo [APP_VERCODE=" + APP_VERCODE + ", APP_VERSION=" + APP_VERSION + ", APP_PACKAGE=" + APP_PACKAGE + ", APP_CHANNEL=" + APP_CHANNEL + ", PHONE_ANDROID_VERSION=" + PHONE_ANDROID_VERSION + ", PHONE_ANDROID_SDK_INT=" + PHONE_ANDROID_SDK_INT + ", PHONE_MODEL=" + PHONE_MODEL + ", PHONE_MANUFACTURER=" + PHONE_MANUFACTURER + ", PHONE_IMEI=" + PHONE_IMEI + ", PHONE_DEVICEID=" + PHONE_DEVICEID + ", APP_DEBUGMODE=" + APP_DEBUGMODE + "]");
    }
}
